<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/10/26
 * Time: 14:05
 */
namespace Trade\Controller;
use Api\Controller\BaseApiController;
use Trade\Model\RedbagModel;
use User\Model\UserModel;
class ApiController extends BaseApiController{

    private $user_db;
    private $trade_db;
    private $mid;
    function _initialize()
    {
        parent::_initialize();
        if (!in_array(ACTION_NAME, array('regist', 'login'))) {
            $this->mid = $this->_initUser(I('uid'));
        }
        $this->user_db = new UserModel();
        $this->trade_db = new TradeModel();
    }

    /**
     * 添加记录
     */
    public function add(){
        $return = $this->add();
        $this->jsonOutput($return);
    }

}